<template>
  <div>
    <el-form>
      <el-form-item label="本年度薪资报表">
        <ve-line v-if="chartData" :data="chartData"></ve-line>
      </el-form-item>
    </el-form>
    <el-form>
      <el-form-item label="上年度薪资报表">
        <ve-line v-if="chartData1" :data="chartData1"></ve-line>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data: function () {
    return {
      Y: null,//年
      M: null,//月
      chartData: {
        columns: ['时间', '薪资'],
        rows: []
      },
      chartData1: {
        columns: ['时间', '薪资'],
        rows: []
      }
    }
  },
  methods: {
    //当年
    Gettest () {
      this.$axios({
        url: '/HrApi/WageMange/GetChartList',
        method: 'GET',
      }).then(res => {
        if (!res.data.code) {
          this.chartData.rows = res.data.data
        }
      })
    },
    //去年
    Gettest2 () {
      this.$axios({
        url: '/HrApi/WageMange/GetChart',
        method: 'GET',
      }).then(res => {
        if (!res.data.code) {
          this.chartData1.rows = res.data.data
        }
      })
    }
  },
  mounted () {
    this.Gettest();
    this.Gettest2()
  }
}
</script>